// index.js
import React, { Component } from 'react'
import { render } from 'react-dom'
import Bar from './components/com_a'
import './styles/index.css'
import { a, b } from './utils' // 提供tree shaking功能, 但是需要是es的模块, 可以去除不必要的代码
// css.use();

class Index extends Component {
  render() {
    return (
      <div>
        <Bar />
        <p className="box" onClick={this.evtAddCss}>Hello world</p>
      </div>
    )
  }
  componentDidMount() {
    import(/* webpackChunkName: 'lazy_com'*/ './components/lazy_component').then(() => {
      console.log(a())
      console.log(b())
    })
  }
  evtAddCss() {
    // import('./styles/index.css')
  }
}

render(
  <Index />,
  document.querySelector('#app')
)